#include<stdio.h>
int main()
{
    int a,z,x,c,v,sum;
    int arr[4]={0};
    scanf("%d",&a);
    for(int i = 0;i<4;i++)
    {
        arr[i]=a%10;
        a=a/10;
    }
    z=(arr[0]+9)%10;
    x=(arr[1]+9)%10;
    c=(arr[2]+9)%10;
    v=(arr[3]+9)%10;
    sum=x*1000+z*100+v*10+c;
    printf("The encrypted number is %d",sum);
    return 0;
}
